import React, { useState } from "react";
import { RefProvider } from "./provider";
import FirstPage from "./first-page";
import SecondPage from "./second-page";
import LastPage from "./last-page";
const contextPage = () => {
    const [number, setNumber] = useState(1)
    const renderContent = (type) => {
        switch (type) {
            case 1:
                return <FirstPage setNumber={setNumber} />
            case 2:
                return <SecondPage setNumber={setNumber} />
            case 3:
                return <LastPage setNumber={setNumber} />
            default:
                return;
        }
    }
    return <RefProvider>
        {renderContent(number)}
    </RefProvider>
}

export default contextPage